Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRMLLoader: New implementation #16726

Merged
merged 2 commits into from
Jun 8, 2019
Merged

VRMLLoader: New implementation #16726

merged 2 commits into from
Jun 8, 2019

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jun 7, 2019

The previous VRMLLoader has produced many issues in the past because of it's line-by-line parsing approach. Although VRML is a very old 3D standard, it has still some significance in various areas like the scientific community. Because of this, I've decided to implement a new VRMLLoader from scratch.

The new loader use as lexer + parser built with chevrotain to convert the VRML into a JSON representation. In the next step, the loader builds a three.js scene similar to the previous one. So the loader is backwards-compatible but it's necessary to include the chevrotain lib in your code. However, this dependency of VRMLLoader will not be noticeable anymore with the JSM version in the future.

Using a lexer/parser approach makes the loader more robust and allows to retain the actual semantic of the VRML tree. Because of this, VRMLLoader can now handle more files than before.

The PR also added support for points, lines, textures, texture transforms and computes normals now according to the VRML standard. I've also created a new directory with some VRML test files that I've used to verify the correctness. But you can also see the difference with the official example.

If you closely compare the geometries of the house, you will see a noticeable improvement and a more consistent result compared to other viewers (e.g. Sketchfab).

This PR closes: #8282, #14814, #15725, #15281

@mrdoob
Copy link
Owner

mrdoob commented Jun 8, 2019

Awesome!

@mrdoob mrdoob added this to the r106 milestone Jun 8, 2019
@mrdoob mrdoob merged commit 76dd2c0 into mrdoob:dev Jun 8, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jun 8, 2019

Thanks!

@coderextreme
Copy link

Hi, Is there any hope that the JSON representation could be converted to the up and coming X3D JSON encoding standard? https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding and https://github.com/coderextreme/X3DJSONLD I'm not saying my implementation of JSON -> DOM is the best possible solution (found in .../X3DJSONLD/src/main/node/X3DJSONLD.js), but it has found a place in X3DOM and X_ITE. If we had the same JSON representation, there might be more interoperability. If you want to influence the X3D JSON standard, join the Web3D Consortium or public mailing lists. For example, we need help with upgrading the JavaScript SAI (Scene Access Interface) API standard.

@mrdoob
Copy link
Owner

mrdoob commented Oct 18, 2019

I don't think we're going to invest much more time on VRML/X3D support ourselves, but we're always welcome to contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading textures on vrmlloader
3 participants